<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        [v-cloak] {
            display: none;
        }
    </style>
</head>

<body>

    <dvi id="app">
        <div v-cloak>{{num}}</div>
        <button @click="numberAdd">点击这里1</button>
        <button @click="numberAdd($event)">点击这里2</button>

        <div @click="handle2">
            <button @click="handle">点击这里1</button>
            <button @click.stop="handle">点击这里2</button>		<!-- Vue 提供的修饰符 -->
        </div>

        <!-- .enter 按到回车键后再执行handle方法 -->
        <input @keyup.enter="handle"/>
        <!-- .delete 按到delete键后再执行handle方法 -->
        <input @keyup.delete="handle"/>


        
    </dvi>
    

    <script src="../../js/vue.js"></script>
    <script>
        var vm = new Vue({
            el: "#app",
            data: {
                num: 0
            },
            methods: {
                numberAdd: function (event) {
                    console.log('~~', event)
                    console.log('event', event.target.tagName)
                    console.log('event', event.target.innerHTML)
                },
                handle: function (event) {
                    this.num++
                    // event.stopPropagation();
                },
                handle2: function (event) {
                    this.num = 100
                }
            }
        })
    </script>
</body>

</html>

